package com.gmail.viktor.yuryev;

import com.intellij.openapi.components.PersistentStateComponent;
import org.jdom.Element;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Viktor Yuryev on 4/10/2014.
 */
public class ServerDetails /*implements PersistentStateComponent<Element>*/ {
    private int port;
    private String host;
    private String login;
    private String password;

    public ServerDetails() {

    }

    public String getSudoPrefix() {
        return sudoPrefix;
    }

    public void setSudoPrefix(String sudoPrefix) {
        this.sudoPrefix = sudoPrefix;
    }

    private String sudoPrefix;

    public String getServerHome() {
        return serverHome;
    }

    public void setServerHome(String serverHome) {
        this.serverHome = serverHome;
    }

    private String serverHome;
    private Map<Path, Path> map = new HashMap<Path, Path>();

    public ServerDetails(String host, String login, String password, int port) {
        this.port = port;
        this.host = host;
        this.login = login;
        this.password = password;
    }


    public void putFolders(Path local, Path remote) {
        map.put(local, remote);
    }

    public void putFolders(String local, String remote) {
        map.put(Paths.get(local), Paths.get(remote));
    }



    public Map<Path, Path> getMapping() {
        return new HashMap<Path, Path>(map);
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
